<include file="public@head"/>
</head>
<body>
<div class="layui-fluid wrap js-check-wrap" id="component-tabs">
    <div class="layui-row">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">模板文件</div>
                <div class="layui-card-body">
                    <form method="post" class="js-ajax-form layui-form">
                        <table class="layui-table">
                            <thead>
                            <tr>
                                <th>文件名</th>
                                <th>操作名</th>
                                <th>文件路径</th>
                                <th>描述</th>
                                <th width="120">{:lang('ACTIONS')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="files" item="vo">
                                <tr>
                                    <td>{$vo.name}</td>
                                    <td>{$vo.action}</td>
                                    <td>{$vo.file}.html</td>
                                    <td>{$vo.description}</td>
                                    <td>
                                        <a class="layui-btn layui-btn-xs" href="javascript:;" data-file="{$vo.id}" data-title="{$vo.name} {$vo.file}.html" onclick="openDesignDialog(this)">设计</a>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<include file="public@footer"/>
<script>
    function openDesignDialog(obj) {
        var $obj = $(obj);
        var fileId = $obj.data('file');
        var title = $obj.data('title');
        parent.openIframeLayer("{:url('theme/fileSetting')}?file_id=" + fileId, title, {
            area: ['80%', '90%'],
            btn: ['确定', '取消'],
            move:'.layui-layer-title',
            yes: function (index, layero) {
                console.log(layero);
                var iframeWin = parent.window[layero.find('iframe')[0]['name']];
                iframeWin.confirm();
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }
</script>
</body>
</html>